Revert "Use absolute error instead of average error for path check"
authorDaniel Sabo <DanielSabo@gmail.com>
Fri, 28 Feb 2014 00:25:45 +0000 (16:25 -0800)
committerDaniel Sabo <DanielSabo@gmail.com>
Tue, 4 Mar 2014 09:28:39 +0000 (01:28 -0800)
I would still like to use absolute error in the future because it
would remove the relationship between the number of zeros in the
test pixels and the total error score, but we do not seem to be at
a stage where that is practical yet (bug 725339).

This reverts commit 56be40fbef61fd32672209d38a5e874fea603e82.

Conflicts:
babl/babl-fish-path.c

babl/babl-fish-path.c
babl/babl-util.c
babl/babl-util.h

index 2637cac1df8091f94dc44a4da2716afd12bd413a..3b90edf17b54ff949fa6ffd2fe8c895794bad167 100644 (file)
@@ -675,9 +675,9 @@ get_path_instrumentation (FishPathInstrumentation *fpi,
   babl_process (fpi->fish_destination_to_rgba,
                 fpi->destination, fpi->destination_rgba_double, fpi->num_test_pixels);
 
-  *path_error = babl_abs_error (fpi->destination_rgba_double,
-                                fpi->ref_destination_rgba_double,
-                                fpi->num_test_pixels * 4);
+  *path_error = babl_rel_avg_error (fpi->destination_rgba_double,
+                                    fpi->ref_destination_rgba_double,
+                                    fpi->num_test_pixels * 4);
 
 #if 0
   fpi->fish_rgba_to_source->fish.processings--;
index f99b54bd95546397c59d7e9bbf3425d234506dbf..92977ac8ca7bda662ee704b8754451a3c12ca6ac 100644 (file)
@@ -88,28 +88,9 @@ babl_process_cost (long ticks_start,
 }
 
 double
-babl_abs_error (const double *imgA,
-                const double *imgB,
-                long          samples)
-{
-  double abs_error = 0.0;
-  long   i;
-
-  for (i = 0; i < samples; i++)
-    {
-      double sample_error = fabs (imgA[i] - imgB[i]);
-
-      if (sample_error > abs_error)
-        abs_error = sample_error;
-    }
-
-  return abs_error;
-}
-
-double
-babl_rel_avg_error (const double *imgA,
-                    const double *imgB,
-                    long          samples)
+babl_rel_avg_error (double *imgA,
+                    double *imgB,
+                    long    samples)
 {
   double error = 0.0;
   long   i;
index 8c49619ea41748d6961292e9472dc5f4466a719f..bdaeec81351eb5cc46549c811348f79078309c08 100644 (file)
@@ -27,12 +27,7 @@ babl_process_cost (long ticks_start,
                    long ticks_end);
 
 double
-babl_rel_avg_error (const double *imgA,
-                    const double *imgB,
-                    long          samples);
-
-double
-babl_abs_error     (const double *imgA,
-                    const double *imgB,
-                    long          samples);
+babl_rel_avg_error (double *imgA,
+                    double *imgB,
+                    long    samples);
 #endif